my $sysctl = fetchall_hash("sysctl");

my $reload = 0;

file_append '/etc/sysctl.conf', "$_ = $sysctl->{$_}\n", qr/^\Q$_\E\s*=/ and $reload++
    foreach sort keys %{ $sysctl };

command 'sysctl', '-p', '/etc/sysctl.conf'
    if $reload;

#my $conf = "";
#$conf = join "\n", map "$_ = $sysctl->{$_}", sort keys %{ $sysctl };
#$conf = "# BEGIN rollout\n$conf\n# END\n" if $conf;
#
#file_append("/etc/sysctl.conf", $conf, sub { /^# BEGIN rollout/../^# END/ },
#    -run => [ 'sysctl', '-p', '/etc/sysctl.conf' ]);

1;

